﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GmailMetroNotifier.Client.Properties;

namespace GmailMetroNotifier.Client.UIP
{
    /// <summary>
    /// Provides a centralized location where specific notification providers can be exposed.
    /// </summary>
    public class NotificationManager
    {
        /// <summary>
        /// Gets a provider for desktop notifications.
        /// </summary>
        public INotificationProvider Desktop { get; private set; }

        /// <summary>
        /// Gets a provider for toast notifications.
        /// </summary>
        public INotificationProvider Toast { get; private set; }

        /// <summary>
        /// Gets a provider for system tray balloon notifications.
        /// </summary>
        public INotificationProvider Tray { get; private set; }

        /// <summary>
        /// Initializes a new instance of the class with a default provider for desktop notifications.
        /// </summary>
        public NotificationManager()
            : this(new DesktopNotificationProvider(), null, null)
        {

        }

        /// <summary>
        /// Initializes a new instance of the class using the given providers.
        /// </summary>
        /// <param name="desktop">The provider to be used for desktop notifications.</param>
        /// <param name="toast">The provider to be used for toast notifications.</param>
        /// <param name="tray">The provider to be used for system tray balloon notifications.</param>
        /// <exception cref="ArgumentException">Thrown when all arguments are null.</exception>
        public NotificationManager(INotificationProvider desktop, INotificationProvider toast, INotificationProvider tray)
        {
            if (desktop == null && toast == null && tray == null)
            {
                throw new ArgumentException(Resources.EXCEPTION_MSG_ARGUMENT_EXCEPTION);
            }

            this.Desktop = desktop;

            this.Toast = toast;

            this.Tray = tray;
        }
    }
}
